<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>数组实战发牌游戏</title>
	</head>

	<body>
		<script>
			//54张纸牌
			//17张，地主 3张。
			//1-4代表  红桃，黑桃，梅花，方块。 A
			//5-8代表  2 

			var cards = [];
			//创建扑克牌
			for(var i = 0; i < 54; i++) {
				cards.push(i);
			}
			//console.log(cards);

			var rand = 0;
			var zs = [],
				ls = [],
				ww = [],
				dp = [];
			//
			//随机抽取
			for(var k = 0; k < 17; k++) {
				rand = parseInt(Math.random() * cards.length)
				//console.log(cards[rand])
				zs.push(cards[rand]);
				cards.splice(rand, 1);

			}

			console.log("张三：" + zs.sort() + "个数" + zs.length);

			//ls的牌
			for(k = 0; k < 17; k++) {
				rand = parseInt(Math.random() * cards.length)

				ls.push(cards[rand]);
				cards.splice(rand, 1);

			}

			console.log("李四：" + ls.sort() + "个数" + ls.length);

			console.log("王五：" + cards.sort() + "个数" + cards.length)

			//54个按钮，+ click事件。splice删除一个。
		</script>
	</body>

</html>